// shop/integral/integral.js
import {getScoreList} from '@/api/shop'
import {
  getmemberinfo
} from '@/api/my'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navIndex:0,
    navList:[
      {
        id:1,
        name:'全部'
      }
      /*,
      {
        id:2,
        name:'获取'
      },
      {
        id:3,
        name:'扣减及失效'
      }
      
       */
    ],
    list:[],
    month:'2024-08',
    monthStr:'',
    memberPoints:0,
  },
  bindDateChange(e){
    console.log(e)
    this.setData({
      monthStr:e.detail.value
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    getmemberinfo({}).then(res => {
      if(res.code == 200){
        this.setData({
          memberPoints: res.data.shopperInfo.memberPoints
        })
      }
    });
    getScoreList({}).then(res => {
      if(res.code == 200){
        this.setData({
          list: res.data
        })
      }
    });
  },
  changeNav(e){
    let { index } = e.currentTarget.dataset
    this.setData({
      navIndex:index
    })
  },
  onShareAppMessage() {
    return {
      title: getApp().globalData.share_title,
      path: getApp().globalData.share_url,
      imageUrl: getApp().globalData.share_image,
    }
  }

})